package org.example.spring.self.demo.pb;

import org.springframework.stereotype.Service;

/**
 * 文件描述
 *
 * @author yezhou41127
 * @date: 2022年09月01日
 */

@Service
public class MessageService {

	private final MessageBuilder messageBuilder;

	MessageService(MessageBuilder messageBuilder) {
		this.messageBuilder = messageBuilder;
	}

	Message createMessage(String content, String receiver) {
		return messageBuilder
				.withContent(content)
				.withReceiver(receiver)
				.build();
	}

}
